Exemplo n.º 1
0
        public async Task <bool> AddList(IList <TUserinfo> list)
        {
            bool rs = false;

            using (DbElectricityNetworkDB db = new DbElectricityNetworkDB())
            {
                rs = await db.InsertAsync(list) == list.Count;
            }
            return(rs);
        }
Exemplo n.º 2
0
        public async Task <bool> AddEntity(TUserinfo t)
        {
            bool rs = false;

            using (DbElectricityNetworkDB db = new DbElectricityNetworkDB())
            {
                rs = await db.InsertAsync(t) == 1;
            }
            return(rs);
        }
Exemplo n.º 3
0
        public async Task <bool> AddEntity(VUserRole t)
        {
            bool rs = false;

            using (DbElectricityNetworkDB db = new DbElectricityNetworkDB())
            {
                using (var transaction = await db.BeginTransactionAsync())
                {
                    rs = await db.InsertAsync(t) == 1;

                    await transaction.CommitAsync();
                }
            }
            return(rs);
        }