public CRUDLBuilderEntityInterfaceService(S service, IEntityMapper mapper) { if (service == null) { throw new ArgumentNullException(nameof(service)); } if (mapper == null) { throw new ArgumentNullException(nameof(mapper)); } internalBuilder = new CRUDLBuilderEntityService <T, M, S>(service, mapper); internalBuilder.With(s => s.Create, s => s.Read, s => s.Update, s => s.Delete, s => s.List); }
public CRUDLBuilderEntityService <T, M, S> Use <S>() where S : class { var service = provider.GetService <S>(); var mapper = GetMapperService(); if (service == null) { throw new NullReferenceException(nameof(service)); } if (mapper == null) { throw new NullReferenceException(nameof(mapper)); } var builder = new CRUDLBuilderEntityService <T, M, S>(service, mapper); return(builder); }