I suggest to use a in-process database like SQL Server CE or SQLite together with an O/R mapper. This is easier and more maintainable than reinventing a small database.
Simple .NET file system persistence?
-
07-07-2023 - |
문제
I need to store some simple data (just some POCO objects with a few attributes, nothing fancy).
public class MyPOCO
{
public int Id {get; set;}
public string Title {get; set;}
public string Email {get; set;}
// ...
}
Basically, at some point of my web application I need to check if the MyPOCO
object is already persisted (matching by Id
), and if it's not, persist it. That's all I need.
It can't be any database, so probably XML
or JSON
. What's an easy way (or Nuget package) to store it?
해결책
제휴하지 않습니다 StackOverflow