コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }