public void AddRepositoryMethod(RepositoryMethod view) { if (RepositoryMethods.FirstOrDefault(k => k.Name == view.Name) != null) { throw new Exception("View name repeated in repository"); } RepositoryMethods.Add(view); }
public int Add(IFlight entity) { int id = RepositoryMethods.Add <Flight>(this.context, (Flight)entity, x => DbFunctions.DiffYears(x.SheduledTime, entity.SheduledTime) == 0 && DbFunctions.DiffMonths(x.SheduledTime, entity.SheduledTime) == 0 && DbFunctions.DiffDays(x.SheduledTime, entity.SheduledTime) == 0 && DbFunctions.DiffHours(x.SheduledTime, entity.SheduledTime) == 0 && DbFunctions.DiffMinutes(x.SheduledTime, entity.SheduledTime) == 0 && x.DestinationAirportId == entity.DestinationAirportId && x.FlightTypeId == entity.FlightTypeId); return(id); }
public int Add(IAirline entity) { int id = RepositoryMethods.Add <Airline>(this.context, (Airline)entity, x => x.Name == entity.Name); return(id); }
public int Add(IFlightType entity) { int id = RepositoryMethods.Add <FlightType>(this.context, (FlightType)entity, x => x.Name == entity.Name); return(id); }
public int Add(IManufacturer entity) { int id = RepositoryMethods.Add <Manufacturer>(this.context, (Manufacturer)entity, x => x.Name == entity.Name); return(id); }
public int Add(IModel entity) { int id = RepositoryMethods.Add <Model>(this.context, (Model)entity, x => x.Name == entity.Name); return(id); }
public int Add(IAirport entity) { int id = RepositoryMethods.Add <Airport>(this.context, (Airport)entity, x => x.Code == entity.Code); return(id); }
public int Add(ITerminal entity) { int id = RepositoryMethods.Add <Terminal>(this.context, (Terminal)entity, x => x.Name == entity.Name); return(id); }