本文整理汇总了C#中IProjectRepository.Add方法的典型用法代码示例。如果您正苦于以下问题:C# IProjectRepository.Add方法的具体用法?C# IProjectRepository.Add怎么用?C# IProjectRepository.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProjectRepository
的用法示例。
在下文中一共展示了IProjectRepository.Add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateDemoData
public static void GenerateDemoData(
IIssueRepository issueRepository,
IProjectRepository projectRepository,
IAttachmentRepository attachmentRepository)
{
Project p = new Project("SHOP", "Webshop", "All issues related to the webshop.");
projectRepository.Add(p);
Issue i = new Issue(p, "Crash after payment", @"I have justed paid for two pairs of shoes - or rather I tried to. When I clicked 'Pay' all I got was a yellow error screen.", 3);
issueRepository.Add(i);
string errorReport = "This is an error report ...";
Attachment att = new Attachment(i, "Error report", "Error report from end user", Encoding.UTF8.GetBytes(errorReport), "text/plain");
attachmentRepository.Add(att);
string logFile = "DEBUG 2014-01-22 15:45:07,610 166033ms [9] Log4NetTraceListener WriteLine - Executing OperationResult OperationResult: type=OK, statusCode=200.";
att = new Attachment(i, "Logfile", "Logfile with server stack trace", Encoding.UTF8.GetBytes(logFile), "text/plain");
attachmentRepository.Add(att);
i = new Issue(p, "Not calculating VAT correctly", @"When I add both shoes and socks it fails to calculate the VAT correctly.", 3);
issueRepository.Add(i);
i = new Issue(p, "General Failure?", @"When I press ctrl-P it says 'General failure reading harddisk'! Who is that General and why is he reading my hard disk?", 5);
issueRepository.Add(i);
}