示例#1
0
        //[Authorize]
        public async Task <IActionResult> GetAllAsync()    //
        {
            AmigosDal am    = new AmigosDal();
            var       Lista = await am.ListarAsync("Nome");

            return(Ok(Lista));
        }
示例#2
0
        public async Task <CodeMsg> DeleteAsync(int RowId)
        {
            CodeMsg cm;

            try
            {
                AmigosDal am = new AmigosDal();
                cm = await am.DeletarAsync(RowId);
            }  catch (Exception) { throw; }
            return(cm);
        }
示例#3
0
        public CodeMsg Delete(int RowId)
        {
            CodeMsg cm;

            try
            {
                AmigosDal am = new AmigosDal();
                cm = am.Deletar(RowId);
            } catch (Exception) { throw; }
            return(cm);
        }
示例#4
0
        public CodeMsg Put(int id, [FromBody] AmigosMd amg)
        {
            CodeMsg cm;

            try
            {
                AmigosDal am = new AmigosDal();
                cm = am.Incluir(amg);
            } catch (Exception) { throw; }
            return(cm);
        }
示例#5
0
        public AmigosMd GetByIdAsync(int id)
        {
            AmigosDal am = new AmigosDal();

            return((AmigosMd)am.GetByIdAsync(id).Result);
        }
示例#6
0
        public AmigosMd GetById(int id)
        {
            AmigosDal am = new AmigosDal();

            return(am.GetById(id));
        }