1

Closed

Проект 1 - Тагване

description

В UserTaggingServices за тагването на User-и трябва да се промени кода за AddTagForUsernameToPictureId по този начин
 
 
[RequiresAuthentication]
 
[Query(HasSideEffects = true)]
 
public IQueryable<UserTag> AddTagForUsernameToPictureId([Required] string username, int pictureId)
 
{
 
return AddTagForUsernameToPictureId(username, pictureId, 0, 0);
 
}
 
[RequiresAuthentication]
 
[Query(HasSideEffects = true)]
 
public IQueryable<UserTag> AddTagForUsernameToPictureId([Required] string username, int pictureId, int x, int y)
 
{
 
var picture = this.GetViewablePicture(pictureId);
 
var user = this.ObjectContext.PhotoAlbumUsers.FirstOrDefault(u => u.UserName == username);
 
if (user != null)
 
{
 
var tag = new UserTag()
 
{
 
AuthorId = this.PhotoUser.Id,
 
UserId = user.Id,
 
PictureId = pictureId,
 
Position = new Position() { X = x, Y = y }
 
};
 
picture.UserTags.Add(tag);
 
this.ObjectContext.SaveChanges();
 
return picture.UserTags.CreateSourceQuery();
 
}
 
return Enumerable.Empty<UserTag>().AsQueryable();
 
}
 
Където е добавено :
 
, int x, int y) и
 
Position = new Position() { X = x, Y = y }
Closed Jul 1, 2010 at 5:47 PM by kowd

comments

kowd wrote Jun 29, 2010 at 2:24 PM

Да, същото като това е :
http://fmisilverlight.codeplex.com/workitem/13612
Оправено е вече, само че кръстих единия метод AddTagAndPositionForUsernameToPictureId.

wrote Jun 29, 2010 at 2:25 PM

wrote Jul 1, 2010 at 5:47 PM

wrote Jan 22, 2013 at 4:00 PM

wrote May 13, 2013 at 10:10 PM