Esempio n. 1
0
        public Task <Tesoros> GetTreasure(Guid Tid)
        {
            Tesoros treasure = db.Tesoro
                               .Where(t => t.Id.Equals(Tid)).FirstOrDefault();

            return(Task.FromResult(treasure));
        }
Esempio n. 2
0
        public Task <bool> SetTreasure(Tesoros T)
        {
            bool status = false;

            try
            {
                db.Tesoro.Add(T);
                db.SaveChanges();
                status = true;
            }
            catch (Exception e)
            {
                status = false;
                Console.WriteLine(e.Message);
            }
            return(Task.FromResult(status));
        }