Skip to content
Wayne edited this page Jul 30, 2015 · 3 revisions

Service

public interface IExampleService : IService<Example>
{
}
public class ExampleService : ServiceBase<Example>, IExampleService
{
}

常用

var service = ServiceLocator.Current.GetInstance<IExampleService>();
service.Add(example);
service.Update(example);
service.Delete(1);
var entity = service.Get(1);
var entities = service.Get("Id", OperatorType.Equal, 1);
var entities = service.Get(new DataFilter().Where("Id", OperatorType.Equal, 1));

Clone this wiki locally