コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        public async Task <ActionResult <object> > Get(int id)
        {
            var entity = ActivitiesMock.GetActivities().FirstOrDefault(x => x.Id == id);

            return(await Task.FromResult(entity));
        }