public void Post([FromBody] BirthdayModel birthDay) { birthDay.Id = 0; _myService.CreateMyEntity(BirthdaysMapper.MapToBirthday(birthDay)); }
public List <BirthdayModel> GetById(int id) { return(BirthdaysMapper.MapToBirthdayModel(_myService.GetMyEntities(bd => bd.Id == id).ToList())); }
public List <BirthdayModel> GetByName(string name) { return(BirthdaysMapper.MapToBirthdayModel(_myService.GetMyEntities(bd => bd.Name.Contains(name.Trim())).ToList())); }
public List <BirthdayModel> GetByBirthdate(string date) { var birthDate = Convert.ToDateTime(date).ToString("yyyy-mm-dd"); return(BirthdaysMapper.MapToBirthdayModel(_myService.GetMyEntities(bd => bd.Birthdate.ToString("yyyy-mm-dd").Equals(birthDate, StringComparison.InvariantCultureIgnoreCase)).ToList())); }
public List <BirthdayModel> Get() { return(BirthdaysMapper.MapToBirthdayModel(_myService.GetAllMyEntities().ToList())); }