public async Task <string> Post([FromBody] Station Station) { var nombre = Station.Name; var x = await _StationRepository.Add(Station); if (x == false) { return("Id already exists!"); } return(""); }
public bool CreateStation(StationCreateViewModel model) { if (_StationRepository.Get(x => x.Deleted == false && x.Name.ToLower().Equals(model.Name.ToLower()) ) == null) { var station = new Station(); station.Name = model.Name; station.CityId = model.CityId; station.CreatedAtUTC = DateTime.UtcNow; _StationRepository.Add(station); _unitOfWork.CommitChanges(); return(true); } return(false); }
public Task Add(Station station) => _stationRepository.Add(station);
//public Category GetCategory(int id) //{ // var category = categorysRepository.GetById(id); // return category; //} //public Category GetCategory(string name) //{ // var category = categorysRepository.GetCategoryByName(name); // return category; //} public void CreateStation(TBL_STATION station) { stationRepository.Add(station); }
public Station Add(Station newStation) { return(_stationRepository.Add(newStation)); }