Search code examples
.netpersistencerapid-prototyping

What's a simple/lightweight way to persist objects in .net during development and experimentation?


I'm looking for a simple way to persist objects when experimenting and creating mock UIs or services. I already know what ORM I'll ultimately use later on when producing a releasable product but I don't want to bother setting it all up at this stage.

I'm looking for something that:

  • has low install requirements (ideally, single dll)
  • has low setup requirements (no column definitions, no XML mappings, no table creation..)
  • has low performance (really just needs to support 1 or 2 concurrent users)
  • persists data across application restarts

What I really want, is something like a hashtable that survives application restarts.

What tools would you see appropriate for this? What approaches do you take when you want to persist simple data structures without any muss?


Solution

  • You could just use the framework's built-in Serialization Support.

    In terms of your requirements:

    • No install requirements (in framework already)
    • No setup requirements (provided types are serializable)
    • Performance is not as good as most ORMs, but still works.
    • Can persist data to files, or any other source that can take a Stream