• EntityFramework 学习 一 Spatial Data type support in Entity Framework 5.0


    MS SQl Server引进两种特殊的数据类型geography and geometry

    public partial class Course
    {
        public Course()
        {
            this.Students = new HashSet<Student>();
        }
        
        public int CourseId { get; set; }
        public string CourseName { get; set; }
        public Nullable<int> TeacherId { get; set; }
        public System.Data.Spatial.DbGeography Location { get; set; }
        
        public virtual Teacher Teacher { get; set; }
        public virtual ICollection<Student> Students { get; set; }
    }
         
    using (var ctx = new SchoolDBEntities())
    {
        ctx.Courses.Add(new Course() { CourseName = "New Course", 
                    Location = DbGeography.FromText("POINT(-122.360 47.656)") });
    
        ctx.SaveChanges();
    }
            
  • 相关阅读:
    hdu 6201 dfs
    Oulipo POJ
    Kitchen Measurements UVALive
    Surf Gym
    hoj 13969 Racing Gems
    分块
    分块学习资料
    Jam's problem again HDU
    树的点分治
    Census UVA
  • 原文地址:https://www.cnblogs.com/lanpingwang/p/6622763.html
Copyright © 2020-2023  润新知