public ReservationPreviewDTO() { this.RenterList = new RenterListDTO(); }
public Task<Sony> ReservedMySony(string SerialNumber, string UsernameRentee, RenterListDTO renterList) { return this._sonyRepository.ReservedMySony(SerialNumber, UsernameRentee, renterList); }
public async Task <Sony> ReservedMySony(string SerialNumber, string UsernameRentee, RenterListDTO renterList) { bool validation = await this.IsSonyFree(SerialNumber, UsernameRentee); if (validation == true) { var result = await _client.Cypher.Match(@"(sony:Sony)").Where((Sony sony) => sony.SerialNumber == SerialNumber) .Match(@"(rentee:Rentee)").Where((Rentee rentee) => rentee.Username == UsernameRentee) .Create("(sony) - [r:RESERVED_BY {renterList}]-> (rentee)").WithParams(new { renterList }) .Return((sony) => new { Sony = sony.As <Sony>() }).ResultsAsync; foreach (var indeks in result) { return(indeks.Sony); } } return(null); }