demo20230512/WCFService/WCFFabService.svc.cs
2023-05-12 10:20:28 +08:00

42 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Web.Mvc;
using Weee.Models;
using Weee.Service;
namespace Weee.WCFService
{
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "WCFFabService" in code, svc and config file together.
// NOTE: In order to launch WCF Test Client for testing this service, please select WCFFabService.svc or WCFFabService.svc.cs at the Solution Explorer and start debugging.
public class WCFFabService : IWCFFabService
{
private readonly WeeeFabDataService service;
public WCFFabService()
{
service = DependencyResolver.Current.GetService<WeeeFabDataService>();
service.DisableProxyAndLazyLoad();
}
public void DoWork()
{
}
public IEnumerable<Fab> GetFabs(string authId)
{
service.Initialize(authId);
return service.GetFabs();
}
public Fab SaveFab(Fab toBeSave, string authId)
{
service.Initialize(authId);
return service.SaveFab(toBeSave);
}
}
}