コード例 #1
0
        public static void VerificaNotificacoes(BaseEntidade value)
        {
            if (value == null)
            {
                throw new Exception("A entidade é nula");
            }

            if (!value.ItsValid)
            {
                throw new Exception($"O objeto do tipo [{value.GetType().ToString()}] possui [{value.GetNumberOfNotifications}] notificações. O mapeamento do mesmo para a unidade de banco não será realizado");
            }
            return;
        }
コード例 #2
0
        public JsonResult GetLocs()
        {
            BaseEntidade db  = new BaseEntidade();
            var          bas = (from x in db.Geoloc
                                select x).ToList();

            var dados = bas.Select(x => new geoloc()
            {
                ID           = x.ID,
                PlaceName    = x.PlaceName,
                OpeningHours = x.OpeningHours,
                GeoLat       = x.GeoLat,
                GeoLong      = x.GeoLong
            });

            return(Json(dados, JsonRequestBehavior.AllowGet));
        }