public void Should_Success_GarmentEMKLProfile() { var mapper = new MapperConfiguration(configuration => configuration.AddProfile <GarmentEMKLProfile>()).CreateMapper(); var model = new GarmentEMKLModel(); var vm = mapper.Map <GarmentEMKLViewModel>(model); Assert.NotNull(vm); }
public async Task <int> CreateAsync(GarmentEMKLModel 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 GarmentEMKLModel GetNewData() { Guid guid = Guid.NewGuid(); GarmentEMKLModel model = new GarmentEMKLModel { Code = $"Code{guid}", Name = $"Name{guid}", Address = $"Address{guid}", Attention = $"Attention{guid}", PhoneNumber = $"PhoneNumber{guid}", FaxNumber = $"FaxNumber{guid}", Email = $"Email{guid}", }; return(model); }
public async Task <int> UpdateAsync(int id, GarmentEMKLModel model) { model.FlagForUpdate(_IdentityService.Username, _UserAgent); _DbSet.Update(model); return(await _DbContext.SaveChangesAsync()); }