예제 #1
0
 public int Update(Build item)
 {
     using (var connection = GetRealTimeConnection())
     {
     connection.Open();
     return connection.Execute("UPDATE [dbo].[Builds] SET RepositoryId = @RepositoryId, BuildDate = @BuildDate, DurationMilliseconds = @DurationMilliseconds, DuplicatesFound = @DuplicatesFound, MaintainabilityIndex = @MaintainabilityIndex, CyclomaticComplexity = @CyclomaticComplexity, DepthOfInheritance = @DepthOfInheritance, ClassCoupling = @ClassCoupling, LinesOfCode = @LinesOfCode, ResultCode = @ResultCode WHERE BuildId = @BuildId", item);
     }
 }
예제 #2
0
 public int Create(Build item)
 {
     using (var connection = GetRealTimeConnection())
     {
     connection.Open();
     int newId = connection.ExecuteScalar<int>("INSERT INTO [dbo].[Builds] VALUES(@RepositoryId, @BuildDate, @DurationMilliseconds, @DuplicatesFound, @MaintainabilityIndex, @CyclomaticComplexity, @DepthOfInheritance, @ClassCoupling, @LinesOfCode, @ResultCode);SELECT SCOPE_IDENTITY()", item);
     return newId;
     }
 }