public async Task <int> DeleteBankNotifyAsync(BankNotifyDTO dto) { await Task.Delay(100); _bankNotifies.Remove(dto); return(0); }
private static BankNotifyDTO GenerateBankNotifyDTOFromModel(BankNotifyModel model) { var bankNotifyDTO = new BankNotifyDTO { Id = model.Id, IsReaded = model.IsReaded, BankName = model.BankName, DateTimeCreated = model.DateTimeCreated, NotifyDescription = model.NotifyDescription }; return(bankNotifyDTO); }
public async Task <int> UpdateBankNotifyAsync(BankNotifyDTO dto) { await Task.Delay(100); var notify = _bankNotifies.FirstOrDefault(nt => nt.Id == dto.Id); if (notify != null) { notify.BankName = dto.BankName; notify.NotifyDescription = dto.NotifyDescription; } return(0); }
public async Task <BankNotifyDTO> CreateBankNotifyAsync(BankNotifyDTO dto) { await Task.Delay(100); long id = 1; if (_bankNotifies.Count > 0) { id = _bankNotifies.Select(x => x.Id).Max() + 1; } dto.Id = id; dto.DateTimeCreated = DateTime.Now; dto.IsReaded = false; _bankNotifies.Add(dto); return(dto); }
private static BankNotifyModel GenerateBankNotifyModelFromDTO(BankNotifyDTO dto) { var model = new BankNotifyModel(dto.Id, dto.BankName, dto.NotifyDescription, dto.DateTimeCreated, dto.IsReaded); return(model); }
public Task <int> UpdateBankNotifyAsync(BankNotifyDTO dto) { throw new NotImplementedException(); }