public void Should_Success_GarmentFabricTypeProfile() { var mapper = new MapperConfiguration(configuration => configuration.AddProfile <GarmentFabricTypeProfile>()).CreateMapper(); var model = new GarmentFabricTypeModel(); var vm = mapper.Map <GarmentFabricTypeViewModel>(model); Assert.NotNull(vm); }
public async Task <int> CreateAsync(GarmentFabricTypeModel model) { model.FlagForCreate(_IdentityService.Username, _UserAgent); model._LastModifiedAgent = model._CreatedAgent; model._LastModifiedBy = model._CreatedBy; model._LastModifiedUtc = model._CreatedUtc; _DbSet.Add(model); return(await _DbContext.SaveChangesAsync()); }
public GarmentFabricTypeModel GetNewData() { Guid guid = Guid.NewGuid(); GarmentFabricTypeModel model = new GarmentFabricTypeModel { Name = $"Name{guid}", }; return(model); }
public async Task <int> UpdateAsync(int id, GarmentFabricTypeModel model) { model.FlagForUpdate(_IdentityService.Username, _UserAgent); _DbSet.Update(model); return(await _DbContext.SaveChangesAsync()); }