1.小问题,估计是作者疏忽:
文件:Entity/Fluent.Validation/SupplierFluent.cs
原代码:
RuleFor(x => x.SupplierName).NotNull().NotEmpty().WithMessage("供应商名称不能为空").Length(1, 50).WithMessage("供应商编号长度不能超过50");
应修改为:
RuleFor(x => x.SupplierName).NotNull().NotEmpty().WithMessage("供应商名称不能为空").Length(1, 50).WithMessage("供应商名称长度不能超过50");
2.我自己新增了Book实体(参考的Supplier实体),故新增了文件及其代码:
Entity/Wms_book.cs,Entity/Fluent.Validation/BookFluent.cs,IRepository/IWms_bookRepository.cs,IServices/IWms_bookServices.cs,KopSoftWms/Controllers/BookController.cs,Repository/Wms_bookRepository.cs(都是参考的参考的Supplier实体)
但是在浏览器里输入~/Book/Index却报错:Unable to resolve service for type 'IServices.IWms_bookServices' while attempting to activate 'KopSoftWms.Controllers.BookController'.
应该是依赖注入的问题。 请作者明示我下原因哈!