Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "fguo"

I ran this query and confirmed I have the Default Tenant record. I can run Angular login page without problem.

The problem occurs only in public mode (Web.Host and Web.Public start together).

I noticed there is a "New Tenant" link on the public page, which directs to a "Tenant SignUp" page.

It seems that I have to set up a new Tenant, or cannot run as "Default" tenant. Is this by design on Public page?

I am trying Core+Angular v5.2.0. While running in public mode (Web.Host and Web.Public start together), I can't change Tenant for login. After I enter the tenant name "Default" on the "Change Tenant" window, it cannot be saved and the popup window cannot be closed. The only way to close this window is clicking the Cancel button or leaving blank on the tenant name box.

Is it a bug or did I miss some thing?

Thanks,

Thank you! I just tried installing Twilio.AspNet.Core. It works! Here is my test controller code:

using Microsoft.AspNetCore.Mvc;
using Twilio.AspNet.Common;
using Twilio.AspNet.Core;
using Twilio.TwiML;

namespace Project.Web.Controllers
{
    [Route("api/[controller]/[action]")]
    public class SmsController : ProjectControllerBase
    {
        [HttpPost]
        public TwiMLResult ReceiveSms(SmsRequest request)
        {
            var messagingResponse = new MessagingResponse();
            messagingResponse.Message("The Robots: " + request.Body);

            return new TwiMLResult(messagingResponse);
        }
    }
}

It's nice to use Twilio.AspNet.Common.SmsRequest. I can get all info from Twilio by this type.

I also tried to merge the above "ReceiveSms" method into /api/services which is ultimately derived from "AbpServiceBase". It does NOT work there. I cannot use "SmsRequest" as input type. The workaround is using string type of input, such as:

public TwiMLResult ReceiveSms(string from, string body){}

Do you have any idea how to use Twilio type "SmsRequest" as input here?

At least, I got a workaround. Thank you very much!!

I tried that. I created an Controller in Web.Core/Controllers, but I have to inherit ControllerBase, otherwise it cannot be routed, and popup error while the swagger opens. If I inherit ControllerBase, the input header as "--header 'Content-Type: application/json-patch+json'", no mater how I manually set the content-type. Here is my test code:

using Microsoft.AspNetCore.Mvc;
using Twilio.AspNet.Mvc;
using Twilio.Rest.Api.V2010.Account;
using Twilio.TwiML;
using Twilio.TwiML.Messaging;

namespace SNet.Web.Controllers
{
    [Route("api/[controller]/[action]")]
    public class SmsController : SNetControllerBase
    {
        private TwilioController m_del;

      public static implicit operator TwilioController(SmsController type)
        {
            return (type.m_del);
        }

        [HttpPost]
        [Produces("text/xml")]
        public TwiMLResult ReceiveSms([FromBody] MessageResource request)
        {
            HttpContext.Response.Headers["Content-Type"] = "text/xml";
            HttpContext.Request.Headers["Content-Type"] = "text/xml";
            
            var messagingResponse = new MessagingResponse();
            messagingResponse.Message("The Robots are coming! Head for the hills!");

            return new TwilioController().TwiML(messagingResponse); //m_del.TwiML(messagingResponse);//m_del always null
        }
    }
}

I just tried to build an .NET app from scratch. The similar Controller works:

using System.Web.Mvc;
using Twilio.AspNet.Mvc;
using Twilio.TwiML;
namespace TwilioReceiver.Controllers
{
	public class SmsController : TwilioController
	{
		[HttpPost]
		public TwiMLResult Index()
		{
			var messagingResponse = new MessagingResponse();
			messagingResponse.Message("Testing...");

			return TwiML(messagingResponse);
		}
	}
}

This API is for 3rd party Twilio to callback. I have to follow Twilio's requirement on input and return type. I wonder how to merge this controller into ASPNETZero package. Can you advise me some thing more?

Thanks,

I am using Core+Angular version 5.1.0. Usually, I build APIs by adding a Service class inheritance from AppServiceBase. APIs built in this way only handle JSON content type, I guess. Now, I need to provide a POST API for 3rd party. It must accept input and return object with content-type other than JSON, such as "application/x-www-form-urlencoded". Can you advise how to specify other content type in service class, or any other approach with ASP.NET Zero?

Thanks,

Not sure what I missed. When use the MyEntity in

IRepository<MyEntity>

, I get compile error: cannot convert to "Abp.Domain.Entities.IEntity<int>".

Do you mean to make entity class like this:

public class MyEntity : Entity<long>{}

It gives out compile error. I can only use :Entity<int> or :Entity.

Can you give me a code example where to put <long>?

thanks,

I have an opposite scenario. I have my own entity "MyUser", which has an "Id" property corresponding to MySQL data type BIGINT(20). "MyUser" class inherent Abp.Domain.Entities.Entity. By convention, I don't need to declare the "Id" in my entity class, but I wonder what type the Abp.Domain.Entities.Entity.Id uses, int32 or int64? in another word, if the "Id" value in MySQL is over int32, does it cause problem? If so, how do I prevent it?

Thanks,

I am working on Core+Angular v5.0.6. It works fine on DEBUG mode. While I publish the Core part, or just build it on Release mode, it pops up errors as following. I searched the files, and found the Application\bin\Release\net461\ and Web.Core\bin\Release\net461\ folders are empty. What did I miss?

Severity Code Description Project File Line Suppression State Error CS0006 Metadata file 'C:\Project\aspnet-core\src\Project.Application\bin\Release\net461\Project.Application.dll' could not be found Project.Web.Core C:\Project\aspnet-core\src\Project.Web.Core\CSC 1 Active Error CS0006 Metadata file 'C:\Project\aspnet-core\src\Project.Application\bin\Release\net461\Project.Application.dll' could not be found Project.Tests C:\Project\aspnet-core\test\Project.Tests\CSC 1 Active Error CS0006 Metadata file 'C:\Project\aspnet-core\src\Project.Application\bin\Release\net461\Project.Application.dll' could not be found Project.Web.Host C:\Project\aspnet-core\src\Project.Web.Host\CSC 1 Active Error CS0006 Metadata file 'C:\Project\aspnet-core\src\Project.Web.Core\bin\Release\net461\Project.Web.Core.dll' could not be found Project.Web.Host C:\Project\aspnet-core\src\Project.Web.Host\CSC 1 Active Error CS0006 Metadata file 'C:\Project\aspnet-core\src\Project.Application\bin\Release\net461\Project.Application.dll' could not be found Project.Web.Public C:\Project\aspnet-core\src\Project.Web.Public\CSC 1 Active Error CS0006 Metadata file 'C:\Project\aspnet-core\src\Project.Web.Core\bin\Release\net461\Project.Web.Core.dll' could not be found Project.Web.Public C:\Project\aspnet-core\src\Project.Web.Public\CSC 1 Active

Showing 91 to 100 of 254 entries