Open naz-hage opened 7 months ago
@ahmdhjj, I'm trying to keep issues small, managable and focused which correspond to a single pull request.
As I look at this issue, it is going to take more than one pull request to complete the current acceptance criteria as writen. I'll adjust the issue and submit the pull request today.
I'm thinking to focuse this issue on creating a simple Record entity instead of the Account Entity, This will give us a chance to learn and iron out the details of adding a new database entity. Let me what you think.
The account entity class and its service class is the first class which contains the properties of an account of a financial institution.
Acceptance Criteria:
Decide on a location for the database: This is a crucial step defining the configuration of your database connection.
Add capability to create, update, delete an account: This is in a repository or service class, not directly in the entity class. The entity class just represents the structure of the data.
Add attributes for input validation: This can be done in the entity class using data annotations. For example, you can use
[Required]
,[StringLength]
, etc. to enforce certain constraints.Add unit tests to validate create, update, or delete an account: This is a good practice to ensure your code is working as expected.
Document the account entity properties and provide an example how to make calls: This includes comments in the code explaining what each property is for, as well as higher-level documentation showing how to use your classes to interact with the database.
[Key]
attribute to represent the primary key of the table.[Required]
,[StringLength]
,[ForeignKey]
, etc.).Here is an example of a complete entity class for a
Product
table:Since we are using SQLite, there are some limitations to keep in mind: