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