PhotoEntity.Controllers.Manager.PropertyGetById C# (CSharp) Method

PropertyGetById() public method

public PropertyGetById ( int id ) : PropertyBase
id int
return PropertyBase
        public PropertyBase PropertyGetById(int id)
        {
            var o = ds.Properties.Find(id);

            return (o == null) ? null : Mapper.Map<PropertyBase>(o);
        }

Usage Example

コード例 #1
0
        // GET: Properties/Details/5
        public ActionResult Details(int?id)
        {
            // Attempt to get the matching object
            var o = m.PropertyGetById(id.GetValueOrDefault());

            if (o == null)
            {
                return(HttpNotFound());
            }
            else
            {
                // Pass the object to the view
                return(View(o));
            }
        }