public void CreatePicture(Picture data)
        {
            DatabaseDataContext context = new DatabaseDataContext();

            context.Pictures.InsertOnSubmit(data);
            context.SubmitChanges();
        }
		private void detach_Pictures(Picture entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		private void attach_Pictures(Picture entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
 partial void DeletePicture(Picture instance);
 partial void UpdatePicture(Picture instance);
 partial void InsertPicture(Picture instance);
        public void UpdatePicture(Picture data)
        {
            DatabaseDataContext context = new DatabaseDataContext();

            Picture picture = context.Pictures.Where(u => u.PictureID == data.PictureID).SingleOrDefault();
            picture.Caption = data.Caption;
            picture.LargeURL = data.LargeURL;
            picture.Latitude = data.Latitude;
            picture.Longitude = data.Longitude;
            picture.MediumURL = data.MediumURL;
            picture.SmallURL = data.SmallURL;
            picture.ViewCount = data.ViewCount;

            context.SubmitChanges();
        }