Base solution for your next web application

Activities of "Dom1702"

Hi,

seems to be fixed, yes. Thanks!

Answer

Thanks!

Answer

Hi ismcagdas,

sorry about that, mb-3 for example indeed works. So using bootstrap grid system is the way to go?

I am asking because in the past metronic had its own classes like "m--margin-top-20", but that is not woking anymore. Also when I use the ASP Net Zero Power Tools I get HTML with all sorts of classes like "form-group m-form__group align-items-center" or "input-group-btn". Is there any page where those classes are described?

Dominik

Hey, thanks again for your help.

I did something different yesterday and it worked. First thing I noticed was, that there is no General tab in the host settings where I could change the timezone. It appeared after adding the line Clock.Provider = ClockProviders.Utc; to the Startup class. After setting the timezone it magically worked. Still don't know what's going on behind the scene though. I guess the moment framework uses the timezone setting and returns the appropriate time instead of UTC?

Hi,

no I'm not. I tried this approach but it's not working either. I cannot find any information about for example the ClockProvider class and how to handle time zones. Any documentation availabe for this I don't know of? The only thing I know for sure is that the service proxies generated by nswag convert time to UTC before sending it to the server. But after receiving the time from the server I just can't get it back to local time. Is this something that should already happen on the server side or is it handled completely by moment in the angular application?

I'd also like to have a best practice guide or something similar

Ah ok, it's not a big deal to upload my current project. Not much done. Can I just zip angular and asp net backend folders, upload it on my space and send you a link via mail?

I'm not sure, what you mean.

What part of the project do you need?

Hi Maliming,

thanks for your help. This is the code:

 private bool ContainsInstructor(DrivingLesson dl, string filter)
        {
            if(dl.Instructors == null) // This is the part I always end up even though there are Instructors available
                return false;
        
            for (int i = 0; i < dl.Instructors.Count; i++)
            {
                if (dl.Instructors[i].Instructor.FirstName.Equals(filter) || dl.Instructors[i].Instructor.LastName.Equals(filter))
                    return true;
            }

            return false;
        }

And this is the actual method:

 public async Task<PagedResultDto<GetDrivingLessonForViewDto>> GetAll(GetAllDrivingLessonsInput input)
         {

            var filteredDrivingLessons = _drivingLessonRepository.GetAllIncluding(e => e.Instructors)
                        .WhereIf(!string.IsNullOrWhiteSpace(input.Filter), e => false || e.Topic.Contains(input.Filter))
                        .WhereIf(input.MinLengthFilter != null, e => e.Length >= input.MinLengthFilter)
                        .WhereIf(input.MaxLengthFilter != null, e => e.Length <= input.MaxLengthFilter)
                        .WhereIf(input.MinStartTimeFilter != null, e => e.StartTime >= input.MinStartTimeFilter)
                        .WhereIf(input.MaxStartTimeFilter != null, e => e.StartTime <= input.MaxStartTimeFilter)
                        .WhereIf(input.CompletedFilter > -1, e => Convert.ToInt32(e.Completed) == input.CompletedFilter)
                        .WhereIf(input.DrivingLessonTopicTopicFilter != null, e => e.Topic.Contains(input.DrivingLessonTopicTopicFilter))
                        .WhereIf(!string.IsNullOrWhiteSpace(input.InstructorFilter), e => ContainsInstructor(e, input.InstructorFilter));

            var query2 = (from o in filteredDrivingLessons

                          select new GetDrivingLessonForViewDto()
                          {
                              DrivingLesson = ObjectMapper.Map<DrivingLessonDto>(o),
                              StudentFullName = (o.StudentFk.FirstName == null || o.StudentFk.LastName == null) ? "" : o.StudentFk.FirstName + " " + o.StudentFk.LastName,
                              Description = o.Description,
                              Instructors = ObjectMapper.Map<IList<Instructors.Dtos.InstructorDto>>((from i in o.Instructors
                                                                                                     join i2 in _lookup_instructorRepository.GetAll() on i.InstructorId equals i2.Id
                                                                                                     select new Instructor() { Id = i2.Id, FirstName = i2.FirstName, LastName = i2.LastName }).ToList())
                          })
                        .WhereIf(!string.IsNullOrWhiteSpace(input.LicenseClassClassFilter), e => e.DrivingLesson.LicenseClass != null && e.DrivingLesson.LicenseClass.ToLower() == input.LicenseClassClassFilter.ToLower().Trim());


            var totalCount = await query2.CountAsync();

            var drivingLessons = await query2
                .OrderBy(input.Sorting ?? "drivingLesson.id asc")
                .PageBy(input)
                .ToListAsync();

            return new PagedResultDto<GetDrivingLessonForViewDto>(
                totalCount,
                drivingLessons
            );
         }

Thanks for your help. I really have no idea how to add this array to the query in way that I don't get the NullReferenceException.

I also tried to use the id in the ContainsInstructor method to get that one driving lesson from the repository, however then I get an exception telling me that I can't nest this query in another query because ef core does not allow this.

Showing 1 to 9 of 9 entries