Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Added FamilyMechList and Mechanism MCS #3

Merged
merged 2 commits into from
Mar 7, 2024
Merged

Added FamilyMechList and Mechanism MCS #3

merged 2 commits into from
Mar 7, 2024

Conversation

ecyr20
Copy link
Contributor

@ecyr20 ecyr20 commented Mar 7, 2024

No description provided.

@ecyr20 ecyr20 merged commit 60b1fc9 into main Mar 7, 2024
1 check passed
Comment on lines +47 to +73
public async Task UpdateFamilyMechListAsync(FamilyMechList familyMechList)
{
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = @"UPDATE Family_Mechanism_List SET family_uuid = @family_uuid, mechanism_uuid = @mechanism_uuid, version = @version, isDel = @isDel WHERE uuid = @uuid;";

command.Parameters.AddWithValue("@uuid", familyMechList.uuid);
command.Parameters.AddWithValue("@family_uuid", familyMechList.family_uuid);
command.Parameters.AddWithValue("@mechanism_uuid", familyMechList.mechanism_uuid);
command.Parameters.AddWithValue("@version", familyMechList.version);
command.Parameters.AddWithValue("@isDel", familyMechList.isDel);

await command.ExecuteNonQueryAsync();
}

public async Task DeleteFamilyMechListAsync(Guid uuid)
{
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = @"UPDATE Family_Mechanism_List SET isDel = 1 WHERE uuid = @uuid;";

command.Parameters.AddWithValue("@uuid", uuid);

await command.ExecuteNonQueryAsync();
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the need to write SQL if you use LINQ

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants