public OperationResult <bool> Update(ReservedQueue item) { try { var reserveCountToday = _dao.List().Count(x => x.ProfileId == item.ProfileId && x.CreatedAt.Day == DateTime.UtcNow.Day && !x.IsDeleted && x.CreatedAt.AddHours(2) > DateTime.UtcNow); var reserveCancelationCountToday = _dao.List().Count(x => x.ProfileId == item.ProfileId && x.CreatedAt.Day == DateTime.UtcNow.Day && x.IsDeleted); if (reserveCountToday > 0 || reserveCancelationCountToday == 2) { return new OperationResult <bool>() { Success = true, Result = false, Message = "Daily limit reached" } } ; _dao.Update(item); return(new OperationResult <bool>() { Success = true, Result = true }); } catch (Exception e) { return(new OperationResult <bool>() { Success = false, Exception = e }); } }
public OperationResult Update(ReservedQueue item) { try { _dao.Update(item); return(new OperationResult() { Success = true }); } catch (Exception e) { return(new OperationResult() { Success = false, Exception = e }); } }