What is the purpose of UserManager methods like GetPhoneNumberAsync(IdentityUser user), when the desired properties can be pulled from user object?

I’m trying to understand some of the logic behind the ASP.Net Core Identity UI views. For example, Account\Manage\Index.cshtml.cs includes the following code: private async Task LoadAsync(IdentityUser user) { var userName = await _userManager.GetUserNameAsync(user); var phoneNumber = await _userManager.GetPhoneNumberAsync(user); Username = userName; Input = new InputModel { PhoneNumber = phoneNumber }; } Why is the call…

Details

Are classes allowed to have different definitions across different translation units in a program?

Is it well-formed to define a class differently in different translation units granted that the class is defined at most once in each translation unit? Use case is accessing implementation details without dynamic allocation. C++ code will operate on pointers already allocated by a C library. Please ignore memory leaks for the sake of example.…

Details

uninitialized constant (NameError) Ruby

I am fairly new to ruby and trying to write a gem file but the following error occurs.I have updated bundler and the relevant gems as was suggested in other posts. Developing with ubuntu 18.04LTS ruby 2.5.1p57 gem 3.1.2 Traceback (most recent call last): 15: from /usr/local/bin/vcdm:23:in `<main>’ 14: from /usr/local/bin/vcdm:23:in `load’ 13: from /var/lib/gems/2.5.0/gems/vcdm-0.1.2/bin/vcdm:4:in…

Details

how to convert bitmap to Uri usnig MediaColumns#IS_PENDING?

I am using the following code to convert bitmap to Uri: fun convertBitmapToUri(context: Context, bitmap: Bitmap): Uri { val bytes = ByteArrayOutputStream() bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bytes) val path = MediaStore.Images.Media.insertImage(context.contentResolver, bitmap, “Title”, null) return Uri.parse(path) } This code works fine. But, after updating the sdk version to 29, insertImage method is deprecated. And when I checked…

Details