コード例 #1
0
        internal Roles(Bar.Data.Roles roles)
        {
            Role_Id = roles.Role_Id;

            Role = roles.Role;

            Active = roles.Active;
        }
コード例 #2
0
        /// <summary>
        ///Populates the instance using data from the datastore.
        ///The lookup of the data in the datastore is based on the instance's current ID value.
        /// </summary>
        private void Load()
        {
            List <Bar.Data.Roles> dataEntityCollection = OxyData.Data.DataProvider <Bar.Data.DataProvider> .Current.GetRolesByRole_Id(Role_Id);

            if (dataEntityCollection.Count == 0)
            {
                throw new InvalidOperationException("Object can't be instantiated: key(s) may be invalid");
            }

            Bar.Data.Roles val = (Bar.Data.Roles)(dataEntityCollection[0]);

            Role_Id = val.Role_Id;

            Role = val.Role;

            Active = val.Active;
        }