Editing a single entity across different controller views w/out calling db with each action? RRS feed

  • Question

  • User-581842504 posted

    I have an object/entity called 'Space'. I want to put each of the different entities (images, details, location, etc) inside 'Space' onto different pages/views so that each part can be edited separately, the user clicks on nav links to edit each section. I don't want to have to fetch the entity from the database every time it posts back to another action. Isn't there a better way to do this?
    Maybe having each one of these as action methods (location, images, details) isn't the correct approach? Please advise! Thanks.

    > https://localhost:12345/managespaces/123/images // you see the form to edit pics for id 123
    > https://localhost:12345/managespaces/123/location //here you only edit loc details for id 123
    > https://localhost:12345/managespaces/123/details //here details are edited for id 123


    public class Space
    public int SpaceId { get; set; }
    [Index(IsUnique = false)]
    public string AspNetUserRefId { get; set; }
    public virtual SpaceOverview Overview { get; set; }
    public virtual SpaceDetails Details { get; set; }
    public virtual ICollection<SpaceImage> Images { get; set; }
    public virtual SpaceListing Listing { get; set; }
    public virtual SpaceAddress Location { get; set; }
    public virtual ICollection<SpaceReview> Reviews { get; set; }
    public DateTime DateCreated { get; set; }
    public SpaceStatus Status { get; set; }
    public virtual ICollection<SpaceEvent> Events { get; set; }

    Thursday, March 5, 2015 3:27 PM

All replies

  • User1689970273 posted

    You need SPA concept in order to implement this.   It's like READ once and manipulate everything in CLIENT side before POSTING it to the server if you want to save into DB.

    Friday, March 13, 2015 11:30 AM