⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 regionstore.cs

📁 简单的cI真的是很简单 你想要就下载吧
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BRISDataAccess.Entity;
using BRISDataAccess.Linq;

namespace BRISDataAccess.DataAccess
{
    
 public class RegionStore
    {
        //Define a private varibles
        PlayerDataContext _playerContext = new PlayerDataContext();

        //Define a Method ,Get Regions Entity
        private RegionsEntity  RegionObjectToEntity(Regions reg)
        {
            RegionsEntity regionsEntity = new RegionsEntity();
            regionsEntity.RegionID = reg.RegionID;
            regionsEntity.RegionDesciption = reg.RegionDescription;
            return regionsEntity;

        }


        //Define a mothed,Get Regions table Informention
       public RegionsCollection GetRegionList()
       {
           RegionsCollection regionsCollection = new RegionsCollection();
         
           IEnumerable<Regions> regionList = from Regioninfo in _playerContext.Regions
                                             select Regioninfo;
           foreach (Regions region in regionList)
           {
               regionsCollection.Add(RegionObjectToEntity(region));
           }

           return regionsCollection;
       }


       //Define a mothed,Get RegionsInfo table Informention by means of importing patameter( regionID)
       public RegionsEntity GetRegionstrongInfo(int regionID)
       {
           RegionsEntity regionsEntity = new RegionsEntity();
           IEnumerable<Regions> regionList = from regionInfo in _playerContext.Regions
                                             where regionInfo.RegionID == regionID
                                             select regionInfo;
           foreach (Regions regions in regionList)
           {
               regionsEntity = this.RegionObjectToEntity(regions);
           
           }

           return regionsEntity;                                                 
       }

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -