Exemplo n.º 1
0
 public async Task AddAsync(BaseDataDto baseData)
 {
     await dataProvider.AddAsync(new BaseData
     {
         ID         = baseData.ID,
         CreateTime = baseData.CreateTime,
         Icon       = baseData.Icon,
         IsDefault  = baseData.IsDefault,
         Key        = baseData.Key,
         Type       = baseData.Type,
         UpdateTime = baseData.UpdateTime,
         Value      = baseData.Value
     });
 }
Exemplo n.º 2
0
        public async Task UpdateAsync(BaseDataDto baseData)
        {
            var model = dataProvider.GetByID(baseData.ID);

            if (model == null)
            {
                throw new Exception("Item not exists!");
            }

            model.Icon       = baseData.Icon;
            model.IsDefault  = baseData.IsDefault;
            model.Key        = baseData.Key;
            model.Type       = baseData.Type;
            model.UpdateTime = DateTime.Now;
            model.Value      = baseData.Value;

            await dataProvider.UpdateAsync(model);
        }
Exemplo n.º 3
0
 internal BaseData(BaseDataDto dto)
 {
     Type    = dto.Type;
     Format  = dto.Format;
     Version = dto.Version;
 }