Example #1
0
 static void LoadAllTopic(IEpiHackdayRepository epiHackdayRepository)
 {
     epiHackdayRepository.GetAll().ToList().ForEach(it =>
     {
         Console.WriteLine($"Id: {it.Id} -Name: {it.Name} -Author: {it.Author} -Created At: {it.CreatedTime}");
     });
 }
Example #2
0
        static void ImportTopicFromFile(IEpiHackdayRepository epiHackdayRepository, string jsonFilePath = "data.json")
        {
            var jsonContent      = File.ReadAllText(jsonFilePath);
            var epiHackDayTopics = JsonSerializer.Deserialize <DB.Access.Entities.HackdayTopic[]>(jsonContent, new JsonSerializerOptions
            {
                PropertyNamingPolicy = JsonNamingPolicy.CamelCase
            });

            epiHackdayRepository.AddTopics(epiHackDayTopics);
            Console.WriteLine("Ok");
        }
Example #3
0
        static void InsertNewTopic(IEpiHackdayRepository epiHackdayRepository)
        {
            var topic = new DB.Access.Entities.HackdayTopic
            {
                Author      = "NgocAnh.Nguyen",
                CreatedTime = DateTime.Now,
                Name        = "High Performance -GRPC in .NET 5.0"
            };

            epiHackdayRepository.AddTopic(topic);
            Console.WriteLine($"New insert topic id: {topic.Id}");
        }
 public HackdayTopicOperation(IEpiHackdayRepository epiHackdayRepository)
 {
     _epiHackdayRepository = epiHackdayRepository;
 }
 public EpiHackdayController(IEpiHackdayRepository epiHackdayRepository)
 {
     _epiHackdayRepository = epiHackdayRepository;
 }
 public EpiHackdayTopicServiceImpl(IEpiHackdayRepository epiHackdayRepository)
 {
     _epiHackdayRepository = epiHackdayRepository;
 }