refactoring

This commit is contained in:
Paul Schneider 2018-08-01 06:12:42 +02:00
commit e1b1347284
20 changed files with 153 additions and 132 deletions

View file

@ -1,37 +1,20 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using Yavsc.Abstract.IT;
using Yavsc.Billing;
using Yavsc.Models.Billing;
using Yavsc.Server.Models.IT.SourceCode;
namespace Yavsc.Server.Models.IT
{
public class ProjectBuildConfiguration
{
[Key]
public long Id { get; set; }
[Required]
public string Name { get; set; }
public long ProjectId { get; set; }
[ForeignKey("ProjectId")]
public virtual Project TargetProject { get; set; }
}
public class Project : NominativeServiceCommand
public class Project : NominativeServiceCommand, IProject
{
[Key]
public override long Id { get; set ; }
public override long Id { get; set; }
public string OwnerId { get; set; }
/// <summary>
/// This field is something like a key,
/// since it is required non null,
@ -51,22 +34,28 @@ namespace Yavsc.Server.Models.IT
[ForeignKey("Name")]
public virtual GitRepositoryReference Repository { get; set; }
List<IBillItem> bill = new List<IBillItem> ();
List<IBillItem> bill = new List<IBillItem>();
public void AddBillItem(IBillItem item)
{
bill.Add(item);
}
public override List<IBillItem> GetBillItems()
{
return bill;
}
public IEnumerable<string> GetConfigurations()
{
return Configurations.Select(c => c.Name);
}
string description;
public override string Description => description;
public Project()
{
}
}
}