public void ImportRound(GolfScoreContext db, string sourcename)
        {
            var sourceAlreadyExists = db.RoundSources.Find(sourcename) != null;

            if (sourceAlreadyExists)
            {
                Log.LogInformation("Source with name {0} already exists", sourcename);
                return;
            }

            RoundSource roundSource = new RoundSource
            {
                SourceName  = sourcename,
                ContentType = "text/CSV",
                Content     = File.ReadAllBytes(FileName)
            };

            db.RoundSources.Add(roundSource);
            db.SaveChanges();
        }
示例#2
0
 public Round GetRoundFromSource(RoundSource roundSource)
 {
     throw new NotImplementedException();
 }