Exemple #1
0
        public async Task <IHttpActionResult> Get(Guid id)
        {
            Room organiser = await Db.Rooms.FindAsync(id);

            if (organiser == null)
            {
                return(NotFound());
            }

            var f = new CampusRoom()
            {
                id       = organiser.Id.ToString(),
                name     = organiser.Name,
                number   = organiser.Number,
                capacity = organiser.Capacity
            };

            return(Ok(f));
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        public IQueryable <CampusRoom> Get()
        {
            var org = Db.Rooms.Where(x => x.Number.StartsWith("R")).ToList();
            var fac = new List <CampusRoom>();

            foreach (var organiser in org)
            {
                var f = new CampusRoom
                {
                    id       = organiser.Id.ToString(),
                    name     = organiser.Name,
                    number   = organiser.Number,
                    capacity = organiser.Capacity
                };

                fac.Add(f);
            }
            return(fac.AsQueryable());
        }