locked
Buffer.BlockCopy problem while manipulating an entity object's byte[] field RRS feed

  • Question

  • Hello, I am a newbie. In SL3, I am trying to upload an image (.jpg ) file to the ms database. While converting my DTO object to the entity object, for some reason Buffer.BlockCopy method doesnT seem to work for me. Below is the beginning of my converter class and the method .. public static class ObjectConverter { public static Pictures DTOtoEntity(PhotoDTOClass dtoObject) { PictureObject entityObject = new PictureObject(); entityObject.Id = dtoObject.Id; //int entityObject.GeoTag = dtoObject.GeoTag; //string entityObject.Photo = new byte[dtoObject.Photo.Length]; //byte[] Buffer.BlockCopy(dtoObject.Photo, 0, entityObject.Photo, 0, dtoObject.Photo.Length); return entityObject; ..... The result I get is an empty array for the Photo field with correct length. If anyone can think of a reason, please help me up. - Orkun
    Sunday, April 4, 2010 8:03 AM

Answers

  • please see the proper formatted thread http://forums.silverlight.net/forums/t/173467.aspx sorry for flooding
    Sunday, April 4, 2010 8:13 AM