Esempio n. 1
0
        public Arena.Services.Contracts.ModifyResult AddPerson(System.IO.Stream stream)
        {
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(Arena.Services.Contracts.Person));

            Arena.Services.Contracts.Person person = (Arena.Services.Contracts.Person)xmlSerializer.Deserialize(stream);

            Contracts.PersonMapper pm = new Contracts.PersonMapper();
            return(pm.Create(person));

            //Arena.Services.Contracts.Person
        }
Esempio n. 2
0
        public Arena.Services.Contracts.Person GetPerson(int id, string fields)
        {
            List <string> strs;

            Arena.Core.Person arenaPersonFromID = new Arena.Core.Person(id);
            if (arenaPersonFromID == null)
            {
                throw new ResourceNotFoundException("Invalid person id");
            }
            if (!string.IsNullOrEmpty(fields))
            {
                char[] chrArray = new char[] { ',' };
                strs = new List <string>(fields.Split(chrArray));
            }
            else
            {
                strs = null;
            }
            Contracts.PersonMapper personMapper = new Contracts.PersonMapper(strs);

            return(personMapper.FromArena(arenaPersonFromID));
        }