public async Task <ActionResult <object> > List(int projectId, string title = "") { var activities = ActivitiesMock.GetActivities(); activities = activities.Where(x => x.Id == projectId && x.Titulo.Contains(title, StringComparison.OrdinalIgnoreCase)).ToList(); return(await Task.FromResult(activities)); }
public async Task <ActionResult <object> > List([FromQuery] string title) { var activities = ActivitiesMock.GetActivities(); if (!string.IsNullOrEmpty(title)) { activities = activities.Where(x => x.Titulo.Contains(title)).ToList(); } return(await Task.FromResult(activities)); }
public async Task <ActionResult <object> > Get(int id) { var entity = ActivitiesMock.GetActivities().FirstOrDefault(x => x.Id == id); return(await Task.FromResult(entity)); }