nuthanm
nuthanm
CC#
Created by slezyradosti on 2/17/2024 in #help
✅ Blob Trigger Azure Function is not triggering
One more reason is if your connection string contains any placeholder or parametrised string then it’s not going to work when you are pointing your azure function with isolated mode
8 replies
CC#
Created by slezyradosti on 2/17/2024 in #help
✅ Blob Trigger Azure Function is not triggering
Please make sure in console for any errors . One main thing is azuirte should be running in command prompt so that you blobs upload or download should work
8 replies
CC#
Created by slezyradosti on 2/17/2024 in #help
✅ Blob Trigger Azure Function is not triggering
I am seeing there are spelling mistakes in connection string and blob trigger. Please cross verify.
8 replies
CC#
Created by ShuajbM on 1/26/2024 in #help
how can i change the version from .net 7 to .net 8
@shuajb; - if it is not showing then you have to Install the runtime and sdk manually and restart your visual studio.
17 replies
CC#
Created by Denge on 1/19/2024 in #help
Authentication: IdentityUser error
Might be version conflict issues with IdentityUser please check in your project file
2 replies
CC#
Created by Cruel on 1/16/2024 in #help
Problem with long running api endpoint
Why can’t you go for background jobs like azure functions or WebJobs and especially you can configure timer so this way in background it process automatically there you can handle your logic
7 replies
CC#
Created by ken on 1/16/2024 in #help
✅ face error in vs code
As i am feeling thay you have multiple projects and it’s confuse which one to run. Please set the project your want to run as set as startup
18 replies
CC#
Created by Raki on 1/16/2024 in #help
Need help on how to write unit tests in xunit for the code
Here I used MOQ library to complete this. We don’t perform actual http call but we configured or setup the response so that it mimics the call and take the defined response and process it. Hope you understand this
5 replies
CC#
Created by Raki on 1/16/2024 in #help
Need help on how to write unit tests in xunit for the code
@Raki - please find the below code and hope it solves your problem. [Fact] public async Task UpdateEntryAsync_ShouldUpdateAndPublish() { // Arrange var contentTypeId = "your_content_type_id"; var entryId = "your_entry_id"; var version = 1; // replace with your actual value var endpoint = "your_api_endpoint"; // you can give any dummy here var httpClientMock = new Mock<IHttpClient>(); var entryService = new EntryService(httpClientMock.Object); // Mocking the response when fetching the entry var entryResponseContent = @"{ 'fields': { 'slug': 'new-slug', 'previousSlug': 'old-slug' } }"; httpClientMock.Setup(client => client.GetAsync($"{endpoint}/{entryId}")) .ReturnsAsync(new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(entryResponseContent, Encoding.UTF8, "application/json") }); // Act await entryService.UpdateEntryAsync(contentTypeId, entryId, version, endpoint); // Assert httpClientMock.Verify(client => client.PutAsync($"{endpoint}/{entryId}", It.IsAny<StringContent>()), Times.Exactly(2)); httpClientMock.Verify(client => client.PutAsync($"{endpoint}/{entryId}/published", It.IsAny<StringContent>()), Times.Once); } }
5 replies